home *** CD-ROM | disk | FTP | other *** search
/ 1000 Apple LAN Literacy / 1000 Apple LAN Literacy.iso / Apple LAN Literacy / Literacy Course / Literacy Course / stack_-1.xml < prev    next >
Extensible Markup Language  |  1989-08-22  |  12KB  |  16 lines

  1. <?xml version="1.0" encoding="utf-8" ?>
  2. <!DOCTYPE stack PUBLIC "-//Apple, Inc.//DTD stack V 2.0//EN" "" >
  3. <stack>
  4.     <name>in</name>
  5.     <id>-1</id>
  6.     <cardCount>4</cardCount>
  7.     <cardID>3071</cardID>
  8.     <listID>3164</listID>
  9.     <cantModify><false /></cantModify>
  10.     <cantDelete><false /></cantDelete>
  11.     <cantAbort><false /></cantAbort>
  12.     <cardSize>
  13.         <width>512</width>
  14.         <height>342</height>
  15.     </cardSize>
  16.     <script>-----------------------------------------------------------------------                    ‚ÄúNetwork & Communications‚Äù--                   ‚ÄúApple LAN Literacy Course‚Äù--                  ¬© 1989 Apple Computer, Inc. &--                     ¬© 1989 Courseware, Inc. &--                        ¬© 1989 HyperPro, Inc.----                          Version 1.0f5------------------------------------------------------------------------ STACK: Literacy Course---- GLOBALS:-- bookmarkPref,course,gSystemFile,mapTracker,menuHilites,-- needDemo,scrapFile,setUpOK,snapFile,snapStack,-- stacks,useSS,whereWeCameFrom---- HANDLERS:-- openStack,getSnapStack,checkHardware,checkCourseStacks,-- makeNewScrapbook,setupScrap,newStudent,dontUseSS----- FUNCTIONS:-- newStudentName,verifyStudentName,myPathName---- By Apple Computer, Inc., Courseware, Inc. & HyperPro, Inc.------------------------------------------------------------------------on openStackglobal setUpOK -- true if we have completed setup properly.global course -- true if course available (used by student services)global useSS -- true if using student servicesglobal scrapFile -- full path name of active "student scrapbook",-- eg HD40:my folder:global snapFile -- full path name to snapshot 0 stackglobal stacks -- HC global, holds path names to look for stacks inglobal needDemo -- true means run it when you get to main menuglobal gSystemFile -- full path name, holds student name, scrapFile,¬¨-- quit card,maptracker,menuhilitesglobal whereWeCameFromglobal snapStack -- number of snapshot stacksglobal bookmarkPref -- true if "make bookmark" is first choiceglobal mapTracker -- where we've beenget the versionif it < 1.2 thengo cd "quit"answer "This course requires HyperCard v1.2.1 or later."exit to HyperCardend ifhide menubarhide msg-- Have we checked the setup already?if setupOk is not empty thenif setupOK thengo cd "start"exit openStackend ifend ifput false into needDemoput true into bookmarkPrefput empty into whereWeCameFromput empty into mapTrackergetHomeInfo -- gets "stacks" global-- use kinfo to tell them what's going onkInfo "show","Checking hardware and software‚Ķ",22222,¬¨"garamond",24, 0, 1, 0go cd 1 -- trap entry by go Recentset cursor to busycheckHardware -- exits if bad-- Check course stacks & original SS stacks if not on original CD Romput myPathName() into thisFolderput offset(":",thisFolder) into countput char 1 to count-1 of thisFolder into thisVolumeif thisVolume ‚↠"Literacy Course" then --*!* or whatever the CDRom is calledset cursor to busycheckCourseStacks thisFolder -- exits if badend if-- Put names of folders of this course into stacksput empty into holderif not (stacks contains thisFolder) thenput thisFolder && return after holderput holder before stackslock screenpush cardset lockmessages to truego cd "stacks" of stack "home"put return & thisFolder after  fld "paths"pop cardunlock screenend ifput thisFolder & "Snapshots 0" into snapFileset cursor to busyput systemFolder() into HDSystemFolder-- Look in system folder for our special file; check name & scrapFileput HDSystemFolder & "LiteracyVars" into gSystemFile --*!*if not CheckExistence(gSystemFile,"file") then-- Assume this is a first-time use of course.-- Get name, copy files to hard disk if they aren't there, etcsetupScrap thisFolder,"" -- exitsend if-- get variables out of our system fileopen File gSystemFileif word one of the result = "couldn't" then-- couldn't create fileput "couldn't create system file" into errorMsgdontUseSS errorMsg,thisFolder -- exitsend ifread from file gSystemFile for 16384put line 1 of it into studentNameput line 2 of it into scrapFileput line 3 of it into whereWeCameFromput line 4 of it into mapTrackerclose file gSystemFileput the number of items of whereWeCameFrom into numItemsif numItems > 3 thendelete item 1 to numItems-3 of whereWeCameFromend if-- Check that scrapbook is really in scrapFile.if scrapFile is empty then setupScrap thisFolder,"" -- exitsif not checkExistence(scrapFile,"file") then-- See if it's a new studentsetupScrap thisFolder,"" -- exitsend if-- scrapbook exists, check whether it's same person as last timeget verifyStudentName(studentName)if it is empty thenput "no name supplied" into errorMsgdontUseSS errorMsg,thisFolder -- exitselseput it into newNameend ifif newName = "new" then -- Instructor is clearing scrapbook.newStudent -- exitsend ifif newName ‚↠studentName then-- see if they have another scrapbook, or create a new one.setupScrap thisFolder,newName -- exitsend if-- It's a continuing student with current scrapbook.put true into setupOKput true into courseput true into useSSgetSnapStackgo card "start"end openStackon getSnapStackglobal snapStack,scrapFileif snapStack is empty thenset lockmessages to truelock screenpush cdgo scrapFileget cd fld "snapshots" of cd "index"put it into snapStackpop cdunlock screenset lockmessages to falseend ifend getSnapStack-- Check that we have the proper hardware (processor, memory, color,-- and video if needed) for the particular course we're on.--on checkHardwareput empty into holderget the heapspace-- ANP needs 700000, literacy needs 192000.  ANP can run without-- videoworks if it has 192000if it < 192000 thenput "Insufficient memory. Check multifinder," &&¬¨"ram cache, inits, and system memory." after holderend ifif holder ‚↠empty thenlock screengo cd "quit"put holder into cd fld "list"show cd fld "list"unlock screenkinfo "hide"answer "Hardware configuration is incorrect."exit to Hypercardend ifend checkHardwareon checkCourseStacks thisFolderput empty into missingput files(thisFolder,STAK) into theFilesrepeat with i = 1 to the number of lines of cd fld "Course files"put line i of cd fld "course files" into theStackif not (theFiles contains theStack) thenput theStack into line (number of lines of missing)¬¨+1 of missingend ifend repeatif missing ‚↠empty thenkinfo "hide"lock screengo cd "quit"put missing into cd fld "list"show cd fld "list"unlock screenanswer "One or more files missing."exit to Hypercardend ifend checkCourseStacks-- On entry, we don't have student's name or a system file, but we-- do know where their system file will go, and the path to the-- folder containing these course stacks.--on setupScrap thisFolder,newNameglobal scrapFile,useSS,setupOk,course,needDemo,gSystemFile,¬¨snapStack,menuHilites,mapTracker,WhereWeCameFromput empty into errormsgkinfo "hide"-- Get name of folder to put this into, or previous folder they-- may have copied to the disk behind our back.answer "Do you have a current Student Scrapbook?"¬¨with "Yes" or "No"if it is "No" thenmakeNewScrapbook thisFolder,newName -- exitsend if-- Ask them where it is and check that it's thereanswer "Please show where your Student Scrapbook is. Click" &&¬¨"OK to begin." with "Cancel" or "OK"if it is "Cancel" thenput "no Student Scrapbook available" into errormsgdontUseSS errorMsg,thisFolder -- exitsend ifget fileName (STAK)-- returns, eg, HD40:Garth's Scrapbook:Student Scrapbookif it is empty or it is "cancel" thenput "couldn't find previous Scrapbook" into errormsgdontUseSS errorMsg,thisFolder -- exitselseput it into scrapFileend if-- Get their name and vars from their scrapbook.lock screenset lockmessages to truepush cardgo stack scrapFileif the result = "cancel" thenset lockMessages to truepop cardunlock screenput "unable to open Student Scrapbook" into errorMsgdontUseSS errorMsg,thisFolder -- exitsend ifif the short name of this stack ‚↠"Student Scrapbook" thenset lockMessages to truepop cardunlock screenput "unable to open Student Scrapbook" into errorMsgdontUseSS errorMsg,thisFolder -- exitsend if-- we're looking at a previous scrapbook they copied to hard diskput cd fld "hidden Name" into studentVarsput line 1 of studentVars into studentNameput line 3 of studentVars into whereWeCameFromput line 4 of studentVars into mapTracker-- delete line 1 to 4 of studentVars-- put studentVars into menuhilites --*!* ANP onlyput cd fld "snapshots" of cd "index" into snapStackset lockmessages to truepop cardunlock screenif studentName is empty then -- shouldn't happenput "name error in Student Scrapbook" into errorMsgdontUseSS errorMsg,thisFolder -- exitsend if-- we have a name, check it outget verifyStudentName(studentName)put it into newNameif newName is empty then -- no name suppliedput "no name supplied" into errorMsgdontUseSS errorMsg,thisFolder -- exitsend ifif newName = studentName then-- update variables and system file; then start courseput false into needDemoopen File gSystemFileif word one of the result = "couldn't" then-- couldn't create fileput "couldn't create system file" into errorMsgdontUseSS errorMsg,thisFolder -- exitsend ifwrite studentName & return & scrapFile & return to file gSystemFilewrite WhereWeCameFrom  & return to file gSystemFilewrite mapTracker & return to file gSystemFile--  write menuHilites to file gSystemFile --*!* ANP onlyclose file gSystemFileput true into useSSput true into setupOkput true into courseset lockmessages to falsego cd "start"exit to hypercard -- exits openstack which sent us hereelse -- name in scrapbook doesn't match name they suppliedput "Student Scrapbook name differs from yours" into errorMsgdontUseSS errorMsg,thisFolder -- exitsend ifend setupScrapon makeNewScrapbook thisFolder,newNameglobal scrapFile,useSS,setupOk,course,needDemo,gSystemFile,¬¨snapStack,menuHilites,mapTracker,WhereWeCameFromif newName is empty thenget newStudentName()if it is empty or it is "cancel" thenput "no personalized Student Scrapbook available" into errorMsgdontUseSS errorMsg,thisFolder -- exitselseput it into studentNameend ifelseput newName into studentNameend ifput word one of studentName & "'s Scrapbook" into newFolderput true into needDemoput empty into WhereWeCameFromput empty into maptracker-- put empty into menuHilites --*!* ANP onlyif studentName = "new" then-- empty system file and exitnewStudent -- exitsend if-- They need to copy scrapbook to a new or current folder.answer "Please choose a folder for your personal Student" &&¬¨"Scrapbook Folder.  Click OK to begin." with "Cancel" or "OK"if it is "cancel" thenput "no personalized Student Scrapbook available" into errorMsgdontUseSS errorMsg,thisFolder -- exitsend ifget newFileName("Enter folder name:",newFolder)if it is empty or it is "cancel" thenput "no personalized Student Scrapbook available" into errorMsgdontUseSS errorMsg,thisFolder -- exitselseput it into newFolderName -- full path name, no colon at end,-- eg HD40:Chosen Folder:Garth's Scrapbookend if-- Create a new folder.  The XFCN checks for enough space and-- volume not locked.put it into newFolderNameput length (newFolderName) into nput newFolderName into putItHererepeat with i = n down to 1if char i of putItHere = ":" thenexit repeatelsedelete char i of putItHereend ifend repeat-- putItHere = eg, HD40:Chosen Folder:get NewFold(newFolderName,putItHere)-- returns "folder created" if successfulif not (it = "folder created") thenif it contains "dup" thenput "Can‚Äôt replace existing Scrapbook with one of same name" into errormsgelseput it into errormsgend ifdontUseSS errorMsg,thisFolder -- exitsend ifset cursor to busy-- use kinfo to tell them what's going onkInfo "show","Copying Student Scrapbook‚Ķ",22222,¬¨"Garamond",24, 0, 1, 0put thisFolder & "Scrapbook 0" into sourceFileput newFolderName & ":Student Scrapbook" into destFileget k